package com.txf.simple.tools;

import android.content.Context;

/**
 * @author txf
 * @Title
 * @package com.txf.simple.tools
 * @date 2016/11/21 0021
 */

public class EquipmentTools {
    private float SCALED_DENSITY;
    private float SCREEN_DENSITY;
    private int SCREEN_HEIGHT;
    private int SCREEN_WIDTH;
    private static EquipmentTools mEquipmentTools;
    public static EquipmentTools getInstance(){
        if(mEquipmentTools == null)
            mEquipmentTools = new EquipmentTools();
        return mEquipmentTools;
    }
    private EquipmentTools(){}
    /**
     * 初始化设备信息
     */
    public void init(Context context) {
        SCREEN_WIDTH = context.getResources().getDisplayMetrics().widthPixels;
        SCREEN_HEIGHT = context.getResources().getDisplayMetrics().heightPixels;
        SCREEN_DENSITY = context.getResources().getDisplayMetrics().density;
        SCALED_DENSITY = context.getResources().getDisplayMetrics().scaledDensity;
        Logger.i("设备信息:" +
                "\n............................................" +
                "\n屏幕宽度 : " + SCREEN_WIDTH +
                "\n屏幕高度 : " + SCREEN_HEIGHT +
                "\n屏幕密度 : " + SCREEN_DENSITY +
                "\n比例缩放屏幕密度 : " + SCALED_DENSITY +
                "\n............................................");
    }
    public float getSCALED_DENSITY() {
        return SCALED_DENSITY;
    }
    public void setSCALED_DENSITY(float SCALED_DENSITY) {
        this.SCALED_DENSITY = SCALED_DENSITY;
    }
    public float getSCREEN_DENSITY() {
        return SCREEN_DENSITY;
    }
    public void setSCREEN_DENSITY(float SCREEN_DENSITY) {
        this.SCREEN_DENSITY = SCREEN_DENSITY;
    }
    public int getSCREEN_HEIGHT() {
        return SCREEN_HEIGHT;
    }
    public void setSCREEN_HEIGHT(int SCREEN_HEIGHT) {
        this.SCREEN_HEIGHT = SCREEN_HEIGHT;
    }
    public int getSCREEN_WIDTH() {
        return SCREEN_WIDTH;
    }
    public void setSCREEN_WIDTH(int SCREEN_WIDTH) {
        this.SCREEN_WIDTH = SCREEN_WIDTH;
    }
}
